<%if(@order != nil)%>
<%form_for(@order, :url => {:action => 'update', :controller => 'admin/orders', :method => 'post'}) do |f|%>
		<p>Gebruikersnaam:
		<%if(@order.user != nil)%>
			<%=link_to @order.user.name, show_admin_users_path(:id => @order.user.id)%>
			<%else%>
			Gast
			<%end%>
		</p>
	
		<p>Voornaam:
		<%=@order.contact_first_name%></p>
		<p>Achternaam:
		<%=@order.contact_surname%></p>
		<p>Adres:
		<%=@order.address_street+" "+@order.address_house_number.to_s+" "+@order.address_house_number_addition%></p>
		<p>Postcode:
		<%=@order.address_postal_code%></p>
		<p>Plaats:
		<%=@order.address_city%></p>
	<%if(@order.address_telephone_number != "")%>
			<p>Telefoonnummer:
			<%=@order.address_telephone_number%></p>
	<%end%>
	<%if(@order.address_fax_number != "")%>
			<p>Fax:
			<%=@order.address_fax_number%></p>
	<%end%>
	<%if(@order.address_mobile_number != "")%>
			<p>Mobiel:
			<%=@order.address_mobile_number%></p>
	<%end%>
	<%if(@order.address_company != "")%>
			<p>Bedrijf:
			<%=@order.address_company%></p>
	<%end%>
		<p>Status:
		<%=f.select(:status, get_status_for_select_box(@order.status), {:selected => @order.status.to_s},{:onchange => 'this.form.submit()'})%></p>
	<%=f.hidden_field(:id, :value => @order.id)%>
<%end%>
		<table>
		
		<%if(@order.order_items.size>0)%>
			<tr>
				<td>Product:</td>
				<td>Aantal:</td>
				<td>Aantal verzonden:</td>
				<td>Prijs:</td>
				<td>Voorraad:</td>
			</tr>
		<%end%>
		<%@order.order_items.each do |item|%>
			<%= render :partial => 'order_item_admin', :locals => {:item => item}%>
		<%end%>
		</table>
	<%end%>
<p>
<% if @indices[0] > -1 then%>
	<%= link_to 'vorige', edit_admin_orders_path(@params, @params[:page] = @indices[0])%>|
<%end%>
<% if @indices[1] != nil then%>
	<%= link_to 'volgende', edit_admin_orders_path(@params, @params[:page] = @indices[1])%>|
<%end%>
</p>
<%= link_to 'Terug', admin_orders_path%>